import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
class HomeGridItem extends StatelessWidget{
  final IconData icon;
  final String text;
  final String url;
  const HomeGridItem({super.key,this.icon=Icons.abc,this.text='',this.url=''});
  @override
  Widget build(BuildContext context) {
    return GestureDetector(
      onTap: () =>{
        context.go('/home/$url')
      },
      child: Container(
        decoration: BoxDecoration(
          color: Colors.white,
          borderRadius: BorderRadius.circular(12),
          boxShadow: const [
            BoxShadow(
              color: Colors.black26,
              offset: Offset.zero,
              blurRadius: 2,
              spreadRadius: 1
            ),
          ]
        ),
        margin: const EdgeInsets.all(10),
        child: Center(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              Icon(
                icon,
                color: Colors.blue,
                size: 40,
              ),
              Container(
                margin: const EdgeInsets.only(top: 4),
                child: Text(text),
              )
              
            ],
          ),
        )
      ),
    );
  }
  void _handleTap(ctx) {
    print('tap... $text');
    print(this.text);
  }
}